<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:dx="http://java.sun.com/jsf/composite/dexter" template="/WEB-INF/template/basic.xhtml">
	<ui:define name="title">
		<h:outputFormat value=" - #{msgs['title.registerOf']}">
			<f:param value="#{complementTitle eq null or complementTitle eq '' ? '' : complementTitle}" />
		</h:outputFormat>
	</ui:define>
	<ui:define name="spaceToolbar">
		<ui:insert name="toolBar">
			<dx:crudMenu id="crudMenu" backingBean="#{backingBeanName}" update="@this :#{idForm}:mainPanel :#{idForm}:myTable"
				showEdit="#{usingDataTableDefault}" showDelete="#{usingDataTableDefault}" />
		</ui:insert>
	</ui:define>
	<ui:define name="main">
		<ui:param name="panelHeader" value="#{msgs['title.registerOf']}" />
		<p:spacer height="1" />
		<p:panel id="mainPanel">
			<f:facet name="header">
				<h:outputFormat value="#{panelHeader}">
					<f:param value="#{complementTitle eq null or complementTitle eq '' ? '' : complementTitle}" disable="#{complementTitle eq null or complementTitle eq ''}" />
				</h:outputFormat>
				<ui:param name="keyState" value="#{backingBeanName.state.description}"/>
				<h:outputText value=" - #{msgs[keyState]}" />
			</f:facet>
			<ui:insert name="spaceFields"/>
			<p:spacer height="1" />
		</p:panel>
		<ui:insert name="table">
			<p:dataTable id="myTable" value="#{backingBeanName.model}" var="obj" emptyMessage="" paginator="true" rows="10"
				paginatorPosition="bottom" paginatorAlwaysVisible="false" rowKey="#{obj}">
				<ui:param name="usingDataTableDefault" value="true" />
				<ui:remove>
					<p:ajax event="rowSelect" update=":#{idForm}:mainPanel" listener="#{backingBeanName.rowSelection}"
						disabled="#{not usingDataTableDefault}" />
					<f:attribute name="selectionMode" value="#{usingDataTableDefault ? 'single' : null}" />
				</ui:remove>
				<ui:insert name="tableColumn">
				</ui:insert>
				<ui:insert name="tableAction">
					<p:column id="editColumn" rendered="#{not usingDataTableDefault}" style="width: 1%;">
						<p:commandButton id="btnEditTable" icon="ui-icon-pencil" actionListener="#{backingBeanName.editAction}" process="@this"
							title="#{msgs['button.edit']}" update=":#{idForm}:crudMenu:toolBarComponent :#{idForm}:mainPanel :#{idForm}:myTable"
							alt="#{msgs['button.edit']}" styleClass="buttonSize">
						</p:commandButton>
					</p:column>
					<p:column id="deleteColumn" rendered="#{not usingDataTableDefault}" style="width: 1%;">
						<p:commandButton id="btnDeleteTable" icon="ui-icon-trash" styleClass="buttonSize" alt="#{msgs['button.delete']}"
							update=":frmDialog:msgPane :frmDialog:btnPane" onclick="if(#{facesContext.maximumSeverity != null}){confirmDialog.show();}" title="#{msgs['button.delete']}">
							<f:param name="msgConfirmation" value="#{msgs['msg.question.deleteRecord']}" />
							<f:param name="actionName" value="delectAction()" />
							<f:setPropertyActionListener target="#{backingBeanName.rowData}" value="#{obj}" />
						</p:commandButton>
					</p:column>
				</ui:insert>
			</p:dataTable>

			<p:remoteCommand name="delectAction" actionListener="#{backingBeanName.deleteAction}" oncomplete="confirmDialog.hide();"
				process="@this" update=":#{idForm}:crudMenu :#{idForm}:mainPanel :#{idForm}:myTable" />
		</ui:insert>
	</ui:define>
</ui:composition>